package nyist.media.controller;

import nyist.media.service.RepairManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 维修员工
 * @author dcf
 * @date 2019/3/17
 */
@RestController
@RequestMapping(value = "/admin/repairs")
@ResponseBody
public class RepairManController extends BaseController{

    @Autowired
    private RepairManService repairManService;

    @GetMapping
    public Map<String, Object> repairmen(Integer page, Integer limit) {
        PageRequest pageRequest = new PageRequest(page - 1, limit);
        return toResultPage(repairManService.findPage(pageRequest));
    }
}
